<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
    <link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='blue.css') }}">
    <link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='pure-min.css') }}">
<title>Flask JQuery</title>
<!-- 插入jquery -->
<script src="{{url_for('static', filename='jquery.min.js')}}"></script>
<script type=text/javascript>
var $SCRIPT_ROOT = {{request.script_root|tojson|safe}};
</script>
<script type=text/javascript>
$(function() {
    function submit_form(e) {
        $.getJSON($SCRIPT_ROOT + '/add', {
            a: $('button[name="11k"]').val(),
        },
        function(data) {}
        );
    };
    // 绑定click事件
    $('#11k').bind('click', submit_form);

    function submit_formb(e) {
        $.getJSON($SCRIPT_ROOT + '/add', {
            a: $('button[name="11g"]').val(),
        },
        function(data) {}
        );
    };
    $('#11g').bind('click', submit_formb);
});
</script>

</head>
<body>

    <div class="pure-g-r">
        <div class="pure-u-1-5"></div>

        <div class="pure-u-3-5">
            <br />
            <div class="pure-center">
            <aside>
                <p>
                    <button id="11k" name=11k value="0#k" class="pure-button pure-button-primary pure-button-large">开</button>
                </p>
                <p>
                    <button id="11g" name=11g value="0#g" class="pure-button pure-button-primary pure-button-large">关</button>
                </p>
            </aside>
            </div>
        </div>

        <div class="pure-u-1-5"></div>
    </div>

</body>
</html> 